<template>
  <div class="wrapper" ref="wrapper">
    <div class="content">
      <slot></slot>
    </div>
  </div>
</template>

<script>
import BScroll from "better-scroll";

export default {
  data() {
    return {
      message: "我是scroll",
      bscroll: null,
    };
  },
  mounted() {
    //   console.log(BScroll)
    this.bscroll = new BScroll(this.$refs.wrapper, {
      probeType: 3,
      observeDOM: true,
      click: true,
      // mouseWheel:true,
    });
    this.bscroll.on("scroll", (options) => {
      // console.log(options)
    });
  },
  methods: {
    // 封装返回顶部按钮
    scrollTopFn(x, y, time = 500) {
      // this.bscroll.scrollTop(x, y, time);
    },
  },
};
</script>

<style scoped>
</style>